<?php
	/*
	*	list game reviews
	*/
	$this->load->helper('form');	
	$this->load->helper('url');
?>

<script languag="javascript">
<!--
	function loadReview(verID)
	{
		var tmpID = 'content_' + verID;
		var x = document.getElementById(tmpID);
		document.addForm.review_content.value = x.innerHTML;
	}
	
	function switchMenu(verID) 
	{
		var tmpID = 'review_'+verID;
		var el = document.getElementById(tmpID);
		if ( el.style.display != 'none' ) 
		{
			el.style.display = 'none';
		}
		else 
		{
			el.style.display = 'block';
		}
	}	
	-->
</script>

<div id="reviews">
	<ul id="reviews-list">
	<?
	$cnt = 0;
	foreach($reviewsList as $review):
		$cnt++;
	?>
	<li>
		<a onclick="switchMenu('<?=$review['version']?>');" >Version: <?= $review['version']; ?></a>
		<div>
			<?= $review['review_time']; ?>
		</div>
		<div>
			<?= $review['user_name']; ?>
		</div>
		<div  id="review_<?=$review['version']?>" style="display:none" >
			<div id="content_<?=$review['version']?>"><?= $review['review_content']; ?></div>
			<a href="javascript:loadReview('<?= $review['version']; ?>');">Edit</a>
		</div>
	</li>
	<? 	
	endforeach; ?>
	</ul>
</div>


